---
layout: page
title: 文章分类
permalink: /category/
---

{% assign rawcates = "" %}
{% for post in site.posts %}
	{% assign ttcate = post.categories | join:'|' | append:'|' %}
	{% assign rawcates = rawcates | append:ttcate %}
{% endfor %}
{% assign rawcates = rawcates | split:'|' | sort %}

{% assign cats = "" %}
{% for tag in rawcates %}
	{% if tag != "" %}
		{% if cats == "" %}
			{% assign cats = tag | split:'|' %}
		{% endif %}
		{% unless cats contains tag %}
			{% assign cats = cats | join:'|' | append:'|' | append:tag | split:'|' %}
		{% endunless %}
	{% endif %}
{% endfor %}
※
{% for tag in cats %}
	<a href="#{{ tag | slugify }}"> {{ tag }} </a> ※
{% endfor %}
<hr />

{% for tag in cats %}
	<h2 id="{{ tag | slugify }}">{{ tag }}</h2>
	<ul>
	 {% for post in site.posts %}
		 {% if post.categories contains tag %}
		 <li>
		 <h3>
		 <a href="{{ post.url }}">
		 {{ post.title }}
		 <small>{{ post.date | date: "%Y-%m-%d" }}</small>
		 </a>
		 </h3>
		 </li>
		 {% endif %}
	 {% endfor %}
	</ul>
{% endfor %}